﻿<UserControl x:Class="BestCode.Creds.UI.VwTemplate"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:controls="clr-namespace:BestCode.Wpf.Controls;assembly=BestCode.Wpf.Controls"
             xmlns:data="clr-namespace:BestCode.Wpf.Controls.Data;assembly=BestCode.Wpf.Controls.Data"
             mc:Ignorable="d" 
             MinHeight="300" MinWidth="500">
    <Grid>
        <controls:FormHeader TitleText="TEMPLATES" DescriptionText="Edit Template form" Margin="0">
            <Grid>
                <data:Navigator Height="99" VerticalAlignment="Top" VisibilityButtonFind="Collapsed">
                    <Grid Margin="0,0,0,0">
                        <TextBox Height="23" Text="{Binding SelectedItem.Code,Mode=TwoWay}" HorizontalAlignment="Left" Margin="50,10,0,0" VerticalAlignment="Top" Width="110" />
                        <TextBox Height="23" HorizontalAlignment="Left" Margin="239,10,0,0"  Text="{Binding SelectedItem.Name, Mode=TwoWay}" VerticalAlignment="Top" Width="179" />
                        <TextBox Height="23" Margin="50,41,123,0"  Text="{Binding SelectedItem.FaceImagePath, Mode=TwoWay}" VerticalAlignment="Top" />

                        <Button Command="{Binding CmdBrowse, Mode=TwoWay}" Content="..." Margin="0,41,82,0" HorizontalAlignment="Right" Width="36" />
                        <TextBlock Text="Code :" Margin="10,12,0,0" FontWeight="Bold" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="35"/>
                        <TextBlock Text="Name :" Margin="194,12,0,0" FontWeight="Bold" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="40"/>
                        <TextBlock Text="Path :" Margin="10,41,0,-1" FontWeight="Bold" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32"/>

                    </Grid>
                </data:Navigator>

                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding Items,Mode=TwoWay}" 
                  SelectedItem="{Binding SelectedItem,Mode=TwoWay}" Margin="6,101,6,24" IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Code" Binding="{Binding Code}"/>
                        <DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
                        <DataGridTextColumn Header="Path" Binding="{Binding FaceImagePath}"/>
                        <DataGridTemplateColumn Width="*" Header="Set Layout">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Button Name="btnChangeLayout" Click="btnChangeLayout_OnClick">Change Layout</Button>
                                    </Grid>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>



                    </DataGrid.Columns>
                </DataGrid>
            </Grid>

        </controls:FormHeader>
    </Grid>
</UserControl>
